<template>
  <div id="app">
    <ul>
      <li v-for="(item, index) in list" :key="item.id">
        {{ index+1 }} | {{ item.id }} | {{ item.name }} | {{ item.nickname }}
        <button @click="del(item.id)">删除</button>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      list: [
        { id: 200, name: '宋江', nickname: '及时雨' },
        { id: 400, name: '吴用', nickname: '智多星' },
        { id: 528, name: '林冲', nickname: '豹子头' }
      ]
    }
  },
  methods:{
    del(id){
  this.list = this.list.filter(item => item.id != id)
    }
  }
}
</script>